package com.butcher.framework.kernel.chain;

import com.butcher.framework.kernel.exc.FastHttpException;

public abstract class Filter {
	protected Filter beforeFilter;
	protected Filter afterFilter;
	protected boolean pass = false;

	public abstract void doBefore() throws FastHttpException;

	public abstract void doAfter(
			com.butcher.framework.kernel.endpoint.http.transform.MessageContext context)
			throws FastHttpException;

	public void setNextBeforeFilter(Filter filter) {
		this.beforeFilter = filter;
	}

	public Filter getNextBeforeFilter() {
		return this.beforeFilter;
	}

	public void setNextAfterFilter(Filter filter) {
		this.afterFilter = filter;
	}

	public Filter getNextAfterFilter() {
		return this.afterFilter;
	}

	public void setPass(boolean pass) {
		this.pass = pass;
	}

	public boolean isPass() {
		return this.pass;
	}
}